package com.aaa.backsystem.shiro;

import com.aaa.backsystem.util.MyConstants;
import org.apache.shiro.crypto.hash.SimpleHash;

public class ShiroUtil {

    /**
     * 加盐加密
     * @param salt
     * @param message
     * @return
     */
    public static String  encryptionBySalt(String salt,String message) {
        //String algorithmName 加密算法, Object source 明文, Object salt 盐值, int hashIterations 加密次数
        String algorithmName = MyConstants.ALGORITHM_NAME;
        int hashIterations = MyConstants.HASH_ITERATIONS;
        SimpleHash simpleHash = new SimpleHash(algorithmName, message, salt, hashIterations);
        return simpleHash.toString();
    }
}
